package hello.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@Api(tags = "页面相关")
public class PageController {

    // 使用thymeleaf模版引擎返回页面例子
    @GetMapping("/")
    @ApiOperation(value = "获取首页")
    public String indexPage(Model model, @RequestParam String msg) {
        model.addAttribute("message", msg);
        return "index";
    }
}
